package com.example.demo.controller;

import com.example.demo.entity.Menu;
import com.example.demo.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {

 	@Autowired
	private IMenuService menuService;

	@RequestMapping("/admin")
	public String indexAdmin(Model model){

		List<Menu> menuList = menuService.selectAll();
		model.addAttribute("menuList",menuList);

		return "admin/index";
	}


}
